*==============================================================================*
*              pollution externalities versus property taxes                   *
*==============================================================================*


*--------------------------- vehicle externality by age -----------------------*
u "dataSTATA/combined/combined_smogcheck_colorado.dta", clear
keep if test_year == 2000
keep if externality_annual > 0 & externality_annual < .
replace age = age - 1 if mod(age,2) == 1
collapse (mean) externality_annual, by(age)
tempfile externality
sa "`externality.dta'", replace

use "replicationFiles/dataSTATA/combined/combined_taxes_externalities.dta", clear

merge 1:1 age using "`externality.dta'"

tw (connected taxLevel age, yscale(noline) msymbol(Sh)) ///
	(connected externality_annual age, yscale(noline axis(2)) yaxis(2) lpattern(dash) ), ///
	graphr(color(white)) ///
	ytit("Annual Property Tax", axis(1)) ///
	ytit("Annual Externality", axis(2)) ///
	legend(order(1 "Annual property tax" 2 "Annual externality")) ///
	xtit("Vehicle Age") ///
	xlab(4 6 8 10 12 14 16 18)
graph save "results/figures/f8_propTaxes/byAge.gph", replace
graph export "results/figures/f8_propTaxes/byAge.eps", replace
graph export "results/figures/f8_propTaxes/byAge.wmf", replace
graph export "$overleaf/figures/f8_propTaxes/byAge.eps", replace

